\(\int \sqrt {-1+\csc ^2(x)} \, dx\) [23]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 10, antiderivative size = 14 \[ \int \sqrt {-1+\csc ^2(x)} \, dx=\sqrt {\cot ^2(x)} \log (\sin (x)) \tan (x) \]

[Out]

ln(sin(x))*(cot(x)^2)^(1/2)*tan(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4206, 3739, 3556} \[ \int \sqrt {-1+\csc ^2(x)} \, dx=\tan (x) \sqrt {\cot ^2(x)} \log (\sin (x)) \]

[In]

Int[Sqrt[-1 + Csc[x]^2],x]

[Out]

Sqrt[Cot[x]^2]*Log[Sin[x]]*Tan[x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3739

Int[(u_.)*((b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Tan[e + f*x]^n)^FracPart[p]/(Tan[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Tan[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rule 4206

Int[(u_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(b*tan[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\cot ^2(x)} \, dx \\ & = \left (\sqrt {\cot ^2(x)} \tan (x)\right ) \int \cot (x) \, dx \\ & = \sqrt {\cot ^2(x)} \log (\sin (x)) \tan (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.29 \[ \int \sqrt {-1+\csc ^2(x)} \, dx=\sqrt {\cot ^2(x)} (\log (\cos (x))+\log (\tan (x))) \tan (x) \]

[In]

Integrate[Sqrt[-1 + Csc[x]^2],x]

[Out]

Sqrt[Cot[x]^2]*(Log[Cos[x]] + Log[Tan[x]])*Tan[x]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(33\) vs. \(2(12)=24\).

Time = 0.57 (sec) , antiderivative size = 34, normalized size of antiderivative = 2.43

method result size
default \(-\frac {\tan \left (x \right ) \left (\ln \left (\frac {2}{\cos \left (x \right )+1}\right )-\ln \left (\csc \left (x \right )-\cot \left (x \right )\right )\right ) \sqrt {\cot \left (x \right )^{2}}\, \sqrt {4}}{2}\) \(34\)
risch \(-\frac {\left ({\mathrm e}^{2 i x}-1\right ) \sqrt {-\frac {\left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, x}{{\mathrm e}^{2 i x}+1}-\frac {i \left ({\mathrm e}^{2 i x}-1\right ) \sqrt {-\frac {\left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \ln \left ({\mathrm e}^{2 i x}-1\right )}{{\mathrm e}^{2 i x}+1}\) \(92\)

[In]

int((csc(x)^2-1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*tan(x)*(ln(2/(cos(x)+1))-ln(csc(x)-cot(x)))*(cot(x)^2)^(1/2)*4^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.50 \[ \int \sqrt {-1+\csc ^2(x)} \, dx=-\log \left (\frac {1}{2} \, \sin \left (x\right )\right ) \]

[In]

integrate((-1+csc(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-log(1/2*sin(x))

Sympy [F]

\[ \int \sqrt {-1+\csc ^2(x)} \, dx=\int \sqrt {\csc ^{2}{\left (x \right )} - 1}\, dx \]

[In]

integrate((-1+csc(x)**2)**(1/2),x)

[Out]

Integral(sqrt(csc(x)**2 - 1), x)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93 \[ \int \sqrt {-1+\csc ^2(x)} \, dx=-\frac {1}{2} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \log \left (\tan \left (x\right )\right ) \]

[In]

integrate((-1+csc(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*log(tan(x)^2 + 1) + log(tan(x))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (12) = 24\).

Time = 0.33 (sec) , antiderivative size = 44, normalized size of antiderivative = 3.14 \[ \int \sqrt {-1+\csc ^2(x)} \, dx=\frac {1}{2} \, {\left (2 \, \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, x\right )^{4} - 1\right ) - \log \left (\tan \left (\frac {1}{2} \, x\right )^{2}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, x\right )^{4} - 1\right )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) \]

[In]

integrate((-1+csc(x)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*(2*log(tan(1/2*x)^2 + 1)*sgn(tan(1/2*x)^4 - 1) - log(tan(1/2*x)^2)*sgn(tan(1/2*x)^4 - 1))*sgn(sin(x))

Mupad [F(-1)]

Timed out. \[ \int \sqrt {-1+\csc ^2(x)} \, dx=\int \sqrt {\frac {1}{{\sin \left (x\right )}^2}-1} \,d x \]

[In]

int((1/sin(x)^2 - 1)^(1/2),x)

[Out]

int((1/sin(x)^2 - 1)^(1/2), x)